package com.ezcolour.ticket.common.controller;

import com.ezcolour.ticket.base.BaseController;
import com.ezcolour.ticket.common.shiro.ShiroKit;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 中央控制器
 *
 * @author rhp
 * @date 2018-3-29 15:29:15
 */
@Controller
public class CoreController extends BaseController {

    /**
     * @author rhp
     */
    @RequestMapping(path = "/")
    public String goHome(Model model) {
        System.out.println("执行core");
        if (ShiroKit.isAuthenticated() || ShiroKit.getUser() != null) {
            return REDIRECT + ADMINPREFIX+ "/";
        } else {
            return REDIRECT + WEBPREFIX +"/page/auth";
        }
    }

}
